<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>Untitled Page</title>
        <meta name="generator" content="WYSIWYG Web Builder 8 - http://www.wysiwygwebbuilder.com">
        <link rel="stylesheet" href="./cupertino/jquery.ui.all.css" type="text/css">
        <link rel="stylesheet" href="adminCss/WebBuilder.css" />
        <script type="text/javascript" src="./jquery-1.6.4.min.js"></script>
        <script type="text/javascript" src="./jquery.ui.core.min.js"></script>
        <script type="text/javascript" src="./jquery.ui.widget.min.js"></script>
        <script type="text/javascript" src="./jquery.ui.datepicker.min.js"></script>
        <script type="text/javascript" src="adminScript/myAdminTableScript.js"></script>
        <script type="text/javascript" src="adminScript/myAdminScript.js"></script>
        <script type="text/javascript">
            $(document).ready(function()
            {
                var jQueryDatePicker1Opts =
                    {
                    dateFormat: 'mm/dd/yy',
                    changeMonth: false,
                    changeYear: false,
                    showButtonPanel: false,
                    showAnim: 'show'
                };
                $("#jQueryDatePicker1").datepicker(jQueryDatePicker1Opts);
            });
        </script>
    </head>
    <body>
        <form name="formAdmin">
            <input type="hidden" name="hidCurPage" id="hidCurPage" />
            <input type="hidden" name="hidTotalPage" id="hidTotalPage" />
            <input type="hidden" name="hidStartNum" id="hidStartNum" />
            <input type="hidden" name="hidEndNum" id="hidEndNum" />
            <input type="hidden" name="hidNCounter" id="hidNCounter" />
            <input type="hidden" name="hidPageName" id="hidPageName" value="mstBarang.php"/>
            
            <input type="text" style="display: none" name="hidIDKategori" id="hidIDKategori" />
            <input type="text" style="display: none" name="hidIDSupplier" id="hidIDSupplier" />
            <input type="text" style="display: none" name="hidUpdate" id="hidUpdate" />
            <input type="text" style="display: none" name="hidUpdateID" id="hidUpdateID" />
            
            <?php
            include("../utility/connection.php");
            include("../utility/general.php");
            include("../model/mBarang.php");
            include("../model/mJenis.php");
            include("../model/mSupplier.php");
            @session_start();
//            unset($_SESSION['startNum']);
//            unset($_SESSION['endNum']);
//            unset($_SESSION['curPage']);
            $kodeUbah = '';
            $idBarang = '';
            $rownum = '';
            $ID = '';
            $Jenis = '';
            $Nama = '';
            $Keterangan = '';
            $Ukuran = '';
            $Warna = '';
            $TglMasuk = '';
            $Harga = '';
            $Jumlah = '';
            $Supplier = '';
            $AlamatSupplier = '';
            $TelpSupplier = '';
            $EmailSupplier = '';
            $kategori_id = '';
            if (isset($_SESSION['ubah'])) {
                $kodeUbah = $_SESSION['ubah'];
                $idBarang = $_SESSION['idBarang'];
                $detilBarang = $_SESSION['detilBarang'];
                
                $rownum = $detilBarang[0];
                $ID = $detilBarang[1];
                $Jenis = $detilBarang[2];
                $Nama = $detilBarang[3];
                $Keterangan = $detilBarang[4];
                $Ukuran = $detilBarang[5];
                $Warna = $detilBarang[6];
                $TglMasuk = $detilBarang[7];
                $Harga = $detilBarang[8];
                $Jumlah = $detilBarang[9];
                $Supplier = $detilBarang[10];
                $AlamatSupplier = $detilBarang[11];
                $TelpSupplier = $detilBarang[12];
                $EmailSupplier = $detilBarang[13];
                $kategori_id = $detilBarang[14];
            }
            ?>
            <div id="wb_Text1" style="position:absolute;left:20px;top:80px;width:130px;height:16px;z-index:0;">
                <span style="color:#000000;font-family:Arial;font-size:13px;">ID Kategori</span></div>
            <select name="Combobox1" size="1" id="Combobox1" style="position:absolute;left:160px;top:80px;width:250px;height:20px;z-index:1;">
                <?php
                $resMstKategori = fnMstIDJenis();
                if ($resMstKategori) {
                    while ($rowMstKategori = mysql_fetch_row($resMstKategori)) {
                        ?>
                        <option value="<?php echo $rowMstKategori[0] ?>" <?php echo ($kategori_id==$rowMstKategori[0])?"SELECTED":"" ?>><?php echo $rowMstKategori[1] ?></option>
                        <?php
                    }
                }
                ?>
            </select>
            <input type="text" id="Editbox1" style="position:absolute;left:160px;top:110px;width:248px;height:18px;line-height:18px;z-index:2;" name="Editbox1" value="<?php echo $Nama ?>">
            <textarea name="TextArea1" id="TextArea1" style="position:absolute;left:160px;top:140px;width:248px;height:98px;z-index:3;" rows="5" cols="35"><?php echo $Keterangan ?></textarea>
            <input type="text" id="Editbox2" style="position:absolute;left:160px;top:250px;width:248px;height:18px;line-height:18px;z-index:4;" name="Editbox2" value="<?php echo $Ukuran ?>">
            <input type="text" id="Editbox3" style="position:absolute;left:160px;top:280px;width:248px;height:18px;line-height:18px;z-index:5;" name="Editbox3" value="<?php echo $Warna ?>">
            <input type="text" id="jQueryDatePicker1" style="position:absolute;left:160px;top:310px;width:248px;height:18px;line-height:18px;z-index:6;" name="jQueryDatePicker1" value="<?php echo $TglMasuk ?>">
            <input type="text" id="Editbox4" style="position:absolute;left:160px;top:340px;width:248px;height:18px;line-height:18px;z-index:7;" name="Editbox4" value="<?php echo $Harga ?>">
            <input type="text" id="Editbox5" style="position:absolute;left:160px;top:370px;width:248px;height:18px;line-height:18px;z-index:8;" name="Editbox5" value="<?php echo $Jumlah ?>">
            <div id="wb_Text2" style="position:absolute;left:20px;top:110px;width:130px;height:16px;z-index:9;">
                <span style="color:#000000;font-family:Arial;font-size:13px;">Nama</span></div>
            <div id="wb_Text3" style="position:absolute;left:20px;top:140px;width:130px;height:16px;z-index:10;">
                <span style="color:#000000;font-family:Arial;font-size:13px;">Keterangan</span></div>
            <div id="wb_Text4" style="position:absolute;left:20px;top:250px;width:130px;height:16px;z-index:11;">
                <span style="color:#000000;font-family:Arial;font-size:13px;">Ukuran</span></div>
            <div id="wb_Text5" style="position:absolute;left:20px;top:280px;width:130px;height:16px;z-index:12;">
                <span style="color:#000000;font-family:Arial;font-size:13px;">Warna</span></div>
            <div id="wb_Text6" style="position:absolute;left:20px;top:310px;width:130px;height:16px;z-index:13;">
                <span style="color:#000000;font-family:Arial;font-size:13px;">Tgl Masuk</span></div>
            <div id="wb_Text7" style="position:absolute;left:20px;top:340px;width:130px;height:16px;z-index:14;">
                <span style="color:#000000;font-family:Arial;font-size:13px;">Harga</span></div>
            <div id="wb_Text8" style="position:absolute;left:20px;top:370px;width:130px;height:16px;z-index:15;">
                <span style="color:#000000;font-family:Arial;font-size:13px;">Jumlah</span></div>
            <select name="Combobox2" size="1" id="Combobox2" style="position:absolute;left:160px;top:400px;width:250px;height:20px;z-index:16;">
                <?php
                $resMstSupplier = fnMstSupplier();
                if ($resMstSupplier) {
                    while ($rowMstSupplier = mysql_fetch_row($resMstSupplier)) {
                        ?>
                        <option value="<?php echo $rowMstSupplier[0] ?>" <?php echo ($Supplier==$rowMstSupplier[1])?"SELECTED":"" ?>><?php echo $rowMstSupplier[1] ?></option>
                        <?php
                    }
                }
                ?>
            </select>
            <div id="wb_Text9" style="position:absolute;left:20px;top:400px;width:130px;height:16px;z-index:17;">
                <span style="color:#000000;font-family:Arial;font-size:13px;">Supplier</span></div>
                
            <button type="button" onclick="fnAddBarang()" id="Button1" name="Button1" style="position:absolute;left:20px;top:440px;width:96px;height:25px;z-index:18;">Simpan</button>
            <button type="button" onclick="fnBatal()" id="Button2" name="Button2" style="position:absolute;left:120px;top:440px;width:96px;height:25px;z-index:19;">Batal</button>
            
            <div id="wb_Text10" style="position:absolute;left:20px;top:10px;width:430px;height:51px;z-index:20;">
                <span style="color:#000000;font-family:Arial;font-size:43px;"><strong>Administrasi Barang</strong></span>
            </div>
        </form>
        <div style="position:absolute;left:20px;top:490px;z-index:21;">
            <?php
            $resAllBarang = fnAllBrg();
            if ((isset($_SESSION['startNum'])) && (isset($_SESSION['endNum']))) {
                $startNum = $_SESSION['startNum'];
                $endNum = $_SESSION['endNum'];
                $resAllBarang = fnAllBrgByRange($startNum, $endNum);
            }

            $TotalBarang = fnAllBrg();
            $TotalRow = mysql_num_rows($TotalBarang);
            include("tablePage.php");
            ?>
        </div>
    </body>
</html>
